#ifdef HAS_INTRO

static long introStartTime;
static long introFadeTime = 3000; //TODO: traelo de lo exportado por DIDI.
static long introTime = 4000; //TODO: traelo de lo exportado por DIDI.
static int introStartY; //TODO: traelo de lo exportado por DIDI.
static int introX; //TODO: traelo de lo exportado por DIDI.
static int introY; //TODO: traelo de lo exportado por DIDI.
static boolean logoAlphaColor_positiveReached = false;
static boolean NoStopAlpha = true;

void updateIntro() 
{
	if (subState == STATES.INIT) 
	{
		introStartY = SCREEN_HEIGHT >> 2;
		introY = introStartY;
		introX = SCREEN_WIDTH >> 1;
		introStartTime = System.currentTimeMillis();
		subState = STATES.UPDATE;
	} 
	else 
	{
		if (System.currentTimeMillis() < introStartTime + introFadeTime) 
		{
			if (introY < ((SCREEN_HEIGHT >> 1) - 30)) introY += 1;
			
			if(logoAlphaColor > 0)
			{
				logoAlphaColor_positiveReached = true;
			}
			else if(logoAlphaColor_positiveReached)
			{
				NoStopAlpha = false;
			}
			
			if(NoStopAlpha)
			{
				logoAlphaColor = FADE_IN(logoAlphaColor, 1);
			}
				
			drawIntro(0);
		} 
		else if (System.currentTimeMillis() < introStartTime + introFadeTime + introTime) 
		{
			drawIntro(1);
		}
		else 
		{
		#ifdef HAS_SET_KEYS
			setState(STATES.SET_KEYS);
		#else
			/* DIDI MESSAGE: implement another way to know if a team has been selected */
			/* THIS WILL BE DELETED - DO NOT USE teamName */
			if (teamName == null) 
			/* DIDI MESSAGE END */
			{
				setState(STATES.TEAM_SELECTION);
			}
		#endif
		}
	}
}

public static final int INTRO_EFFECT_NO_EFFECT = 0;
public static final int INTRO_EFFECT_FADE_IN = INTRO_EFFECT_NO_EFFECT + 1;

void drawIntro(int effectCode) 
{
	int logoX = introX - ((logo.getWidth() >> 1) - 20);
	int logo2X = introX - ((logo.getWidth() >> 1) + 18);
	
	cGame_g.setClip(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
	cGame_g.setColor(0xffffff);
	cGame_g.fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
	cGame_g.drawImage(logo, logoX, introY, 0);
	
	if(effectCode == INTRO_EFFECT_FADE_IN) 
	{
		cGame_g.setClip(logo2X, introY, logo_pel.getWidth(), logo.getHeight());
		cGame_g.drawImage(logo_o, logo2X, introY, 0);

		cGame_g.drawAlphaRect(logo2X, introY, logo_pel.getWidth(), logo.getHeight(), logoAlphaColor, true);
	} 
	else if(effectCode == INTRO_EFFECT_NO_EFFECT) 
	{
		cGame_g.drawImage(logo_pel, logo2X, introY, 0);
	}
}

#endif